﻿Public Class Resources
  Public Shared Function GetResourceURL(ByVal URLPrefix As String, ByVal code As String, ByVal extension As String, ByVal name As String, ByVal verifyLink As Boolean) As String
    Dim url = URLPrefix & code & "." & extension
    Dim url2 = URLPrefix & code.ToLower & "." & extension.ToLower
    Dim finalurl As String = ""

    Dim addlink As Boolean

    If Helpers.PageVerify.PageExists(url, verifyLink) Then
      addlink = True
      finalurl = url
    Else
      addlink = False
    End If

    If addlink = False AndAlso Helpers.PageVerify.PageExists(url2.ToLower, verifyLink) Then
      addlink = True
      finalurl = url2
    End If

    If addlink = False Then
      finalurl = ""
    End If

    Return finalurl

  End Function

End Class
